<template>
  <div>
    <swiper :imgList="imgList"></swiper>    <!--封装swiper组件-->
  </div>
</template>

<script>
import swiper from '../components/swiper.vue'
export default {
  data(){
    return{
      imgList:[]
    }
  },
  created(){
    this.getImgList()
  },
  methods:{
    getImgList(){
      this.$indicator.open({
        text:'加载中'
      })
      this.$http.get('imglist').then(res=>{
        this.$indicator.close()
        if (res.data.code ===0){
          this.$toast('加载轮播图失败')
        }else{
          this.imgList = res.data.data
        }
      })
    }
  },
  components: { swiper },     //创建轮播节点

}
</script>

<style>
</style>

